﻿namespace System.Lua
{
    /// <summary>
    /// Contains extension methods for strings.
    /// </summary>
    public static class StringExtensions
    {
        /// <summary>
        /// Returns a value indicating whether the string contains any of the substrings.
        /// </summary>
        /// <param name="value">The string.</param>
        /// <param name="substrings">An array of strings to check.</param>
        /// <returns><c>true</c>, if the string contains any of the substrings; <c>false</c> otherwise.</returns>
        public static bool ContainsAny(this string value, string[] substrings)
        {
            foreach (string substring in substrings)
            {
                if (value.Contains(substring))
                    return true;
            }

            return false;
        }
    }
}
